public class Test2 {

    public static boolean isAdmin(String userId){
        return userId.toLowerCase()=="admin";
    }
    public static void main(String[] args){
        System.out.println(isAdmin("Admin"));
    }
    //第一个只出现一次的字符
    public int firstUniqChar(String s) {
        int[] count = new int[26];
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            count[ch-'a']++;
        }
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            if(count[ch-'a'] == 1) {
                return i;
            }
        }
        return -1;
    }
    //最后一个单词的长度

    public static void main2(String[] args) {
        StringBuilder stringBuilder = new StringBuilder("abc");
        System.out.println(stringBuilder);

        stringBuilder.append("123").append(10);
        stringBuilder.append(19.9);

        System.out.println(stringBuilder);//此时 不会产生临时对象

//        //字符串逆置
//        stringBuilder.reverse();
//        System.out.println(stringBuilder);
    }
    public static void main1(String[] args) {
        String str = "hello";
        str += "abc";
        System.out.println(str);
    }
}
